package array;

public class ArrayDemo2 {
    public static void main(String[] args) {
        //定义一个数组
        int[] arr = {1,2,3,4,5,6,7,9};
        System.out.println("arr = " + arr);//地址值
        //获取数组长度和元素个数的公式
        System.out.println("arr.length = " + arr.length);//9


        //数组名[索引]
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);

        }
    }
}
